package DataBase;

import java.sql.PreparedStatement;
import java.sql.SQLException;

public class DeleteRecipe {
	
	private String recID;
	
	
	public DeleteRecipe(String recID ) {
		
		this.recID=recID;
	    
	}

	public void deleteRecipe()
	{

		SQLConnection sc=new SQLConnection();
		
		try {
			
			PreparedStatement ps1 = sc.getConnection().prepareStatement("DELETE FROM recipe WHERE  Rid=? ");	
			ps1.setString(1,recID);
			sc.getConnection().setAutoCommit(false);
			ps1.executeUpdate();
			sc.getConnection().commit();
			ps1.close();
			 sc.getConnection().close();
		}
		
		catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		}
		
		
		
		
	}
	
	



